import requests
url = 'http://www.baidu.com'
response = requests.get(url)
response.encoding = response.apparent_encoding
print(response.text)